<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<s:set name="date_type" value="%{@com.japp.tools.common.SelectVal@getDataToDateType(t.date_type)}"></s:set>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>实际经营数据管理</title>
<s:include value="/app_common/common.jsp"></s:include>
<!-- 日期选择框start -->
<script type="text/javascript" src="<s:property value='webctx'/>/libs/js/form/datePicker/WdatePicker.js"></script>
<!-- 日期选择框end -->
<style type="text/css">
.topTable{
	width: 100%;
}
</style>
</head>
<body>
<div style="text-align: center;font-weight: bold;"><s:property value="type_name"/>量化考核排名[<s:property value="date_type"/>](南京营业部)</div>
<div style="overflow-y:auto;overflow-x:auto;height: 100%;width: 100%">
	<form name="form1" id="form1" action="<s:property value='webctx'/>/reality/qt_findRealityTop.action" method="post" target="frmright">
		<fieldset>
			<legend>数据检索</legend>
			<table>
				<tr>
					<td>时间类型:</td>
					<td>
						<select name="t.date_type" id="ei_date_type" onchange="checkDateType(this)" selectedValue="<s:property value='t.date_type'/>" data='{"list":[{"value":"1","key":"日"},{"value":"2","key":"周"},{"value":"3","key":"月"},{"value":"4","key":"季度"},{"value":"5","key":"半年"},{"value":"6","key":"年"}]}'></select>
					</td>
					<td>检索时间:</td>
		 			<td id="tb_date">
		 				<input type="text" dateFmt="yyyy-MM-dd" id="ei_date"  name="t.date" value="<s:property value='t.date'/>" class="date" readonly="readonly" style="cursor: pointer;" isShowWeek="true"/>
		 			</td>
		 			<td><input type="button" id="btn1" onclick="checkSearch()" value="数据检索"></td>
				</tr>
			</table>
		</fieldset>
	</form>
	<table border="0" cellpadding="0" cellspacing="0" class="tableStyle">
		<tr>
			<th colspan="11">
			<s:if test="t.date_type==1">
				<s:property value="t.date"/>(<s:property value="date_type"/>)
			</s:if>
			<s:elseif test="t.date_type==2">
				<s:property value="t.date.substring(0,4)"/>年,第<s:property value="t.cdate"/>周
			</s:elseif>
			<s:elseif test="t.date_type==3">
				<s:property value="t.date.substring(0,4)"/>年<s:property value="t.date.substring(5,7)"/>月份
			</s:elseif>
			<s:elseif test="t.date_type==4">
				<s:property value="t.date.substring(0,4)"/>年,第<s:property value="t.cdate"/>季度 
			</s:elseif>
			<s:elseif test="t.date_type==5">
				<s:property value="t.date.substring(0,4)"/>年<s:property value="t.cdate==1?'上半年':'下半年'"/>
			</s:elseif>
			<s:elseif test="t.date_type==6">
				<s:property value="t.date.substring(0,4)"/>年
			</s:elseif>
			业务分部及业务人员各项量化指标排行榜</th>
		</tr>
		<tr>
			<th>客户拜访数（个）</th>
			<th>个人潜在客户数（个）</th>
			<th>机构潜在客户数（个）</th>
			<th>潜在客户合计数（个）</th>
			<th>个人开户数（个）</th>
			<th>机构开户数（个）</th>
			<th>开户合计数（个）</th>
			<th>个人入金交易数（个）</th>
			<th>机构入金交易数（个）</th>
			<th>入金交易合计数（个）</th>
			<th>50万以上交易数（个）</th>
		</tr>
		<tr>
			<td>
				<table class="topTable" style="line-height: 30px;">
					<tr>
						<th>排名</th>
						<th>分部</th>
						<th>本<s:property value="date_type"/>数</th>
						<th>占总比</th>
					</tr>
					<s:iterator value="map['khqy']" status="stat">
						<s:if test="data_type==1">
							<tr>
								<td><s:property value="q"/></td>
								<td><s:property value="dp_name"/></td>
								<td class="bnums"><s:property value="type_sum"/></td>
								<td class="nums"><s:property value="type_sum/map['1']"/></td>
							</tr>
						</s:if>
					</s:iterator>
				</table>
			</td>
			<td>
				<table class="topTable" style="line-height: 30px;">
					<tr>
						<th>排名</th>
						<th>分部</th>
						<th>本<s:property value="date_type"/>数</th>
						<th>占总比</th>
					</tr>
					<s:iterator value="map['jye']" status="stat">
						<s:if test="data_type==1">
							<tr>
								<td><s:property value="q"/></td>
								<td><s:property value="dp_name"/></td>
								<td class="bnums"><s:property value="type_sum"/></td>
								<td class="nums"><s:property value="type_sum/map['2']"/></td>
							</tr>
						</s:if>
					</s:iterator>
				</table>
			</td>
			<td>
				<table class="topTable" style="line-height: 30px;">
					<tr>
						<th>排名</th>
						<th>分部</th>
						<th>本<s:property value="date_type"/>数</th>
						<th>占总比</th>
					</tr>
					<s:iterator value="map['sxfsr']" status="stat">
						<s:if test="data_type==1">
							<tr>
								<td><s:property value="q"/></td>
								<td><s:property value="dp_name"/></td>
								<td class="bnums"><s:property value="type_sum"/></td>
								<td class="nums"><s:property value="type_sum/map['3']"/></td>
							</tr>
						</s:if>
					</s:iterator>
				</table>
			</td>
			<td>
				<table class="topTable" style="line-height: 30px;">
					<tr>
						<th>排名</th>
						<th>分部</th>
						<th>本<s:property value="date_type"/>数</th>
						<th>占总比</th>
					</tr>
					<s:iterator value="map['glfy']" status="stat">
						<s:if test="data_type==1">
							<tr>
								<td><s:property value="q"/></td>
								<td><s:property value="dp_name"/></td>
								<td class="bnums"><s:property value="type_sum"/></td>
								<td class="nums"><s:property value="type_sum/map['4']"/></td>
							</tr>
						</s:if>
					</s:iterator>
				</table>
			</td>
			<td>
				<table class="topTable" style="line-height: 30px;">
					<tr>
						<th>排名</th>
						<th>分部</th>
						<th>本<s:property value="date_type"/>数</th>
						<th>占总比</th>
					</tr>
					<s:iterator value="map['yyfy']" status="stat">
						<s:if test="data_type==1">
							<tr>
								<td><s:property value="q"/></td>
								<td><s:property value="dp_name"/></td>
								<td class="bnums"><s:property value="type_sum"/></td>
								<td class="nums"><s:property value="type_sum/map['5']"/></td>
							</tr>
						</s:if>
					</s:iterator>
				</table>
			</td>
			<td>
				<table class="topTable" style="line-height: 30px;">
					<tr>
						<th>排名</th>
						<th>分部</th>
						<th>本<s:property value="date_type"/>数</th>
						<th>占总比</th>
					</tr>
					<s:iterator value="map['yyly']" status="stat">
						<s:if test="data_type==1">
							<tr>
								<td><s:property value="q"/></td>
								<td><s:property value="dp_name"/></td>
								<td class="bnums"><s:property value="type_sum"/></td>
								<td class="nums"><s:property value="type_sum/map['6']"/></td>
							</tr>
						</s:if>
					</s:iterator>
				</table>
			</td>
			<td>
				<table class="topTable" style="line-height: 30px;">
					<tr>
						<th>排名</th>
						<th>分部</th>
						<th>本<s:property value="date_type"/>数</th>
						<th>占总比</th>
					</tr>
					<s:iterator value="map['ywzdf']" status="stat">
						<s:if test="data_type==1">
							<tr>
								<td><s:property value="q"/></td>
								<td><s:property value="dp_name"/></td>
								<td class="bnums"><s:property value="type_sum"/></td>
								<td class="nums"><s:property value="type_sum/map['7']"/></td>
							</tr>
						</s:if>
					</s:iterator>
				</table>
			</td>
			<td>
				<table class="topTable" style="line-height: 30px;">
					<tr>
						<th>排名</th>
						<th>分部</th>
						<th>本<s:property value="date_type"/>数</th>
						<th>占总比</th>
					</tr>
					<s:iterator value="map['clf']" status="stat">
						<s:if test="data_type==1">
							<tr>
								<td><s:property value="q"/></td>
								<td><s:property value="dp_name"/></td>
								<td class="bnums"><s:property value="type_sum"/></td>
								<td class="nums"><s:property value="type_sum/map['8']"/></td>
							</tr>
						</s:if>
					</s:iterator>
				</table>
			</td>
			<td>
				<table class="topTable" style="line-height: 30px;">
					<tr>
						<th>排名</th>
						<th>分部</th>
						<th>本<s:property value="date_type"/>数</th>
						<th>占总比</th>
					</tr>
					<s:iterator value="map['clf9']" status="stat">
						<s:if test="data_type==1">
							<tr>
								<td><s:property value="q"/></td>
								<td><s:property value="dp_name"/></td>
								<td class="bnums"><s:property value="type_sum"/></td>
								<td class="nums"><s:property value="type_sum/map['9']"/></td>
							</tr>
						</s:if>
					</s:iterator>
				</table>
			</td>
			<td>
				<table class="topTable" style="line-height: 30px;">
					<tr>
						<th>排名</th>
						<th>分部</th>
						<th>本<s:property value="date_type"/>数</th>
						<th>占总比</th>
					</tr>
					<s:iterator value="map['clf10']" status="stat">
						<s:if test="data_type==1">
							<tr>
								<td><s:property value="q"/></td>
								<td><s:property value="dp_name"/></td>
								<td class="bnums"><s:property value="type_sum"/></td>
								<td class="nums"><s:property value="type_sum/map['10']"/></td>
							</tr>
						</s:if>
					</s:iterator>
				</table>
			</td>
			<td>
				<table class="topTable" style="line-height: 30px;">
					<tr>
						<th>排名</th>
						<th>分部</th>
						<th>本<s:property value="date_type"/>数</th>
						<th>占总比</th>
					</tr>
					<s:iterator value="map['clf11']" status="stat">
						<s:if test="data_type==1">
							<tr>
								<td><s:property value="q"/></td>
								<td><s:property value="dp_name"/></td>
								<td class="bnums"><s:property value="type_sum"/></td>
								<td class="nums"><s:property value="type_sum/map['11']"/></td>
							</tr>
						</s:if>
					</s:iterator>
				</table>
			</td>
		</tr>
		<tr>
			<td>
				<table class="topTable" style="line-height: 30px;">
					<tr>
						<th>排名</th>
						<th>业务人员</th>
						<th>本<s:property value="date_type"/>数</th>
						<th>占分部比</th>
						<th>占总比</th>
					</tr>
					<s:iterator value="map['khqy']" status="stat">
						<s:if test="data_type==2">
							<tr>
								<td><s:property value="q"/></td>
								<td><s:property value="uname"/></td>
								<td class="bnums"><s:property value="type_csum"/></td>
								<td class="nums"><s:property value="type_csum/type_sum"/></td>
								<td class="nums"><s:property value="type_csum/map['1']"/></td>
							</tr>
						</s:if>
					</s:iterator>
				</table>
			</td>
			<td>
				<table class="topTable" style="line-height: 30px;">
					<tr>
						<th>排名</th>
						<th>业务人员</th>
						<th>本<s:property value="date_type"/>数</th>
						<th>占分部比</th>
						<th>占总比</th>
					</tr>
					<s:iterator value="map['jye']" status="stat">
						<s:if test="data_type==2">
							<tr>
								<td><s:property value="q"/></td>
								<td><s:property value="uname"/></td>
								<td class="bnums"><s:property value="type_csum"/></td>
								<td class="nums"><s:property value="type_csum/type_sum"/></td>
								<td class="nums"><s:property value="type_csum/map['2']"/></td>
							</tr>
						</s:if>
					</s:iterator>
				</table>
			</td>
			<td>
				<table class="topTable" style="line-height: 30px;">
					<tr>
						<th>排名</th>
						<th>业务人员</th>
						<th>本<s:property value="date_type"/>数</th>
						<th>占分部比</th>
						<th>占总比</th>
					</tr>
					<s:iterator value="map['sxfsr']" status="stat">
						<s:if test="data_type==2">
							<tr>
								<td><s:property value="q"/></td>
								<td><s:property value="uname"/></td>
								<td class="bnums"><s:property value="type_csum"/></td>
								<td class="nums"><s:property value="type_csum/type_sum"/></td>
								<td class="nums"><s:property value="type_csum/map['3']"/></td>
							</tr>
						</s:if>
					</s:iterator>
				</table>
			</td>
			<td>
				<table class="topTable" style="line-height: 30px;">
					<tr>
						<th>排名</th>
						<th>业务人员</th>
						<th>本<s:property value="date_type"/>数</th>
						<th>占分部比</th>
						<th>占总比</th>
					</tr>
					<s:iterator value="map['glfy']" status="stat">
						<s:if test="data_type==2">
							<tr>
								<td><s:property value="q"/></td>
								<td><s:property value="uname"/></td>
								<td class="bnums"><s:property value="type_csum"/></td>
								<td class="nums"><s:property value="type_csum/type_sum"/></td>
								<td class="nums"><s:property value="type_csum/map['4']"/></td>
							</tr>
						</s:if>
					</s:iterator>
				</table>
			</td>
			<td>
				<table class="topTable" style="line-height: 30px;">
					<tr>
						<th>排名</th>
						<th>业务人员</th>
						<th>本<s:property value="date_type"/>数</th>
						<th>占分部比</th>
						<th>占总比</th>
					</tr>
					<s:iterator value="map['yyfy']" status="stat">
						<s:if test="data_type==2">
							<tr>
								<td><s:property value="q"/></td>
								<td><s:property value="uname"/></td>
								<td class="bnums"><s:property value="type_csum"/></td>
								<td class="nums"><s:property value="type_csum/type_sum"/></td>
								<td class="nums"><s:property value="type_csum/map['5']"/></td>
							</tr>
						</s:if>
					</s:iterator>
				</table>
			</td>
			<td>
				<table class="topTable" style="line-height: 30px;">
					<tr>
						<th>排名</th>
						<th>业务人员</th>
						<th>本<s:property value="date_type"/>数</th>
						<th>占分部比</th>
						<th>占总比</th>
					</tr>
					<s:iterator value="map['yyly']" status="stat">
						<s:if test="data_type==2">
							<tr>
								<td><s:property value="q"/></td>
								<td><s:property value="uname"/></td>
								<td class="bnums"><s:property value="type_csum"/></td>
								<td class="nums"><s:property value="type_csum/type_sum"/></td>
								<td class="nums"><s:property value="type_csum/map['6']"/></td>
							</tr>
						</s:if>
					</s:iterator>
				</table>
			</td>
			<td>
				<table class="topTable" style="line-height: 30px;">
					<tr>
						<th>排名</th>
						<th>业务人员</th>
						<th>本<s:property value="date_type"/>数</th>
						<th>占分部比</th>
						<th>占总比</th>
					</tr>
					<s:iterator value="map['ywzdf']" status="stat">
						<s:if test="data_type==2">
							<tr>
								<td><s:property value="q"/></td>
								<td><s:property value="uname"/></td>
								<td class="bnums"><s:property value="type_csum"/></td>
								<td class="nums"><s:property value="type_csum/type_sum"/></td>
								<td class="nums"><s:property value="type_csum/map['7']"/></td>
							</tr>
						</s:if>
					</s:iterator>
				</table>
			</td>
			<td>
				<table class="topTable" style="line-height: 30px;">
					<tr>
						<th>排名</th>
						<th>业务人员</th>
						<th>本<s:property value="date_type"/>数</th>
						<th>占分部比</th>
						<th>占总比</th>
					</tr>
					<s:iterator value="map['clf']" status="stat">
						<s:if test="data_type==2">
							<tr>
								<td><s:property value="q"/></td>
								<td><s:property value="uname"/></td>
								<td class="bnums"><s:property value="type_csum"/></td>
								<td class="nums"><s:property value="type_csum/type_sum"/></td>
								<td class="nums"><s:property value="type_csum/map['8']"/></td>
							</tr>
						</s:if>
					</s:iterator>
				</table>
			</td>
			<td>
				<table class="topTable" style="line-height: 30px;">
					<tr>
						<th>排名</th>
						<th>业务人员</th>
						<th>本<s:property value="date_type"/>数</th>
						<th>占分部比</th>
						<th>占总比</th>
					</tr>
					<s:iterator value="map['clf9']" status="stat">
						<s:if test="data_type==2">
							<tr>
								<td><s:property value="q"/></td>
								<td><s:property value="uname"/></td>
								<td class="bnums"><s:property value="type_csum"/></td>
								<td class="nums"><s:property value="type_csum/type_sum"/></td>
								<td class="nums"><s:property value="type_csum/map['9']"/></td>
							</tr>
						</s:if>
					</s:iterator>
				</table>
			</td>
			<td>
				<table class="topTable" style="line-height: 30px;">
					<tr>
						<th>排名</th>
						<th>业务人员</th>
						<th>本<s:property value="date_type"/>数</th>
						<th>占分部比</th>
						<th>占总比</th>
					</tr>
					<s:iterator value="map['clf10']" status="stat">
						<s:if test="data_type==2">
							<tr>
								<td><s:property value="q"/></td>
								<td><s:property value="uname"/></td>
								<td class="bnums"><s:property value="type_csum"/></td>
								<td class="nums"><s:property value="type_csum/type_sum"/></td>
								<td class="nums"><s:property value="type_csum/map['10']"/></td>
							</tr>
						</s:if>
					</s:iterator>
				</table>
			</td>
			<td>
				<table class="topTable" style="line-height: 30px;">
					<tr>
						<th>排名</th>
						<th>业务人员</th>
						<th>本<s:property value="date_type"/>数</th>
						<th>占分部比</th>
						<th>占总比</th>
					</tr>
					<s:iterator value="map['clf11']" status="stat">
						<s:if test="data_type==2">
							<tr>
								<td><s:property value="q"/></td>
								<td><s:property value="uname"/></td>
								<td class="bnums"><s:property value="type_csum"/></td>
								<td class="nums"><s:property value="type_csum/type_sum"/></td>
								<td class="nums"><s:property value="type_csum/map['11']"/></td>
							</tr>
						</s:if>
					</s:iterator>
				</table>
			</td>
		</tr>
	</table>
</div>

</body>
<script type="text/javascript">
function checkDateType(obj){
	var val = obj.value;
	var str = "";
	if(val==1){
		str = '<input type="text" dateFmt="yyyy-MM-dd" id="ei_date"  name="t.date" value="<s:property value='t.date_type!=1?@com.japp.tools.common.Common@getThisDate():t.date'/>" class="date" readonly="readonly" style="cursor: pointer;"/>';
	}else if(val==2){
		str = '<input type="text" dateFmt="yyyy-MM-dd" id="ei_date"  name="t.date" value="<s:property value='t.date_type!=2?@com.japp.tools.common.Common@getThisDate():t.date'/>" class="date" readonly="readonly" style="cursor: pointer;" isShowWeek="true"/>';
	}else if(val==3){
		str = '<input type="text" dateFmt="yyyy-MM" id="ei_date"  name="t.date" value="<s:property value='t.date_type!=3?(@com.japp.tools.common.Common@getThisDate()).substring(0,7):t.date.substring(0,7)'/>" class="date" readonly="readonly" style="cursor: pointer;"/>';
	}else if(val==4){
		str = '<div style="float:left;"><input type="text" dateFmt="yyyy" id="ei_date"  name="t.date" value="<s:property value='t.date.substring(0,4)'/>" class="date" readonly="readonly" style="cursor: pointer;"/></div>';
		str += '<div style="float:right;"><select name="t.cdate" id="ei_cdate" selectedValue="<s:property value='t.date_type!=4?1:t.cdate'/>" data=\'{"list":[{"value":"1","key":"第一季度"},{"value":"2","key":"第二季度"},{"value":"3","key":"第三季度"},{"value":"4","key":"第四季度"}]}\'></select></div>';
	}else if(val==5){
		str = '<div style="float:left;"><input type="text" dateFmt="yyyy" id="ei_date"  name="t.date" value="<s:property value='t.date.substring(0,4)'/>" class="date" readonly="readonly" style="cursor: pointer;"/></div>';
		str += '<div style="float:right;"><select name="t.cdate" id="ei_cdate"  selectedValue="<s:property value='t.cdate.length>2?1:t.cdate'/>" data=\'{"list":[{"value":"1","key":"上半年(1~6)"},{"value":"2","key":"下半年(6~12)"}]}\'></select></div>';
	}else if(val==6){
		str += '<input type="text" dateFmt="yyyy" id="ei_date"  name="t.date" value="<s:property value='t.date.substring(0,4)'/>" class="date" readonly="readonly" style="cursor: pointer;"/>';
	}
	if(val!=4&&val!=5&&val!=2){
		str+='<input type="hidden" name="t.cdate" id="ei_cdate" value="<s:property value='t.cdate'/>">';
	}
	$('#tb_date').empty().append(str);
	$('#ei_date').dateRender();
	if(val==4||val==5){
		$('#ei_cdate').selectRender();
	}
	//<td id="tb_date">
	//	<input type="text" dateFmt="yyyy-MM-dd" id="ei_date"  name="t.date" value="<s:property value='t.date'/>" class="date" readonly="readonly" style="cursor: pointer;" isShowWeek="true"/>
	//</td>
}
$(function(){
	checkDateType(document.getElementById('ei_date_type'));
	var text = null;
	$('.nums').each(function(){
		text = Number($(this).text());
		$(this).text(toPercent(text,2));
	});
	$('.bnums').each(function(){
		text = Number($(this).text());
		$(this).text(text);
	});
	var chil;
	$('.topTable').each(function(){
		chil = $(this).children().children('tr').length;
		if(chil==1){
			$(this).after('<div>没有检索到符合条件的数据!</div>');
			$(this).remove();
		}
	});
});
function checkSearch(){
	showProgressBar();
	document.form1.submit();
}
</script>
</html>